package com.ww.java.generic;

import java.util.ArrayList;
import java.util.List;

/**
 * 泛型只在编译阶段有效
 */
public class Demo1 {
    @SuppressWarnings("rawtypes")
	public static void main(String[] args) {
        List<String> strArrayList = new ArrayList<>();
        List<Integer> intArrayList = new ArrayList<>();

        Class<? extends List> strArrayListClass = strArrayList.getClass();
        Class<? extends List> intArrayListClass = intArrayList.getClass();

        if (strArrayListClass.equals(intArrayListClass)) {
            System.out.println("泛型类型，其实类型都相同，" + strArrayListClass.getName());
        }
    }
}
